import request, {upload} from '~/utils/request';

//获取项目的已购买车位
export function getParkingFromProject(data) {
    return request({
        url: '/Owner/GetParkingFromProject',
        method: 'post',
        data,
    });
}

//获取项目的已购买业主
export function getOwnerFromProject(data) {
    return request({
        url: '/Owner/GetOwnerFromProject',
        method: 'post',
        data,
    });
}

//获取业主购买车位列表列表（分页显示）
export function getBuyList(data) {
    return request({
        url: '/Owner/GetBuyList',
        method: 'post',
        data,
    });
}

//导出业主购买车位列表列表
export function getBuyListAll(data) {
    return request({
        url: '/Owner/GetBuyListAll',
        method: 'post',
        data,
    });
}

//获取业主购买车位列表列表（分页显示）
export function getBuyListMy(data) {
    return request({
        url: '/Owner/GetBuyListMy',
        method: 'post',
        data,
    });
}

//导出业主购买车位列表列表
export function getBuyListAllMy(data) {
    return request({
        url: '/Owner/GetBuyListAllMy',
        method: 'post',
        data,
    });
}

//保存业主购买记录
export function saveBuyInfo(data) {
    return request({
        url: '/Owner/SaveBuyInfo',
        method: 'post',
        data,
    });
}

//购买单条记录
export function getBuyInfo(data) {
    return request({
        url: '/Owner/GetBuyInfo?buyid=' + data,
        method: 'get',
    });
}

//获取业主信息
export function getBuyInfoByOwnerID(data) {
    return request({
        url: '/Owner/GetBuyInfoByOwnerID?ownerid=' + data,
        method: 'get',
    });
}

//获取项目中未购买套餐的业主列表
export function getOwnerBuyPackageList(data) {
    return request({
        url: '/Owner/GetOwnerBuyPackageList',
        method: 'post',
        data,
    });
}

//设置业主自购套餐赠品
export function setOwnerSelfBuy(data) {
    return request({
        url: '/Owner/SetOwnerSelfBuy',
        method: 'post',
        data,
    });
}

//业主资产调整
export function modifyOwnerBalance(data) {
    return request({
        url: '/Owner/ModifyOwnerBalance',
        method: 'post',
        data,
    });
}

//业主申请列表
export function getOwnerApplyList(data) {
    return request({
        url: '/Owner/GetOwnerApplyList',
        method: 'post',
        data,
    });
}

//业主申请列表
export function setOwnerApplyState(data) {
    return request({
        url: '/Owner/SetOwnerApplyState',
        method: 'post',
        data,
    });
}

//业主自购功能开关
export function setGiftOpen(data) {
    return request({
        url: '/Owner/SetGiftOpen',
        method: 'post',
        data,
    });
}

//获取业主详情页基本信息
export function getOwnerInfoBy(data) {
    return request({
        url: '/Owner/GetOwnerInfoBy',
        method: 'post',
        data,
    });
}

//获取业主充值列表
export function getOwnerRechargeList(data) {
    return request({
        url: '/Owner/GetOwnerRechargeList',
        method: 'post',
        data,
    });
}

//获取业主购买列表
export function getOwnerOrderList(data) {
    return request({
        url: '/Owner/GetOwnerOrderList',
        method: 'post',
        data,
    });
}
//获取业主车位列表
export function getOwnerBuyList(data) {
    return request({
        url: '/Owner/GetOwnerBuyList',
        method: 'post',
        data,
    });
}

//业主购买状态调整（已购转预购）
export function setBuyState(data) {
    return request({
        url: '/Owner/SetBuyState',
        method: 'post',
        data,
    });
}

//业主购房保存
export function saveHouseInfo(data) {
    return request({
        url: '/Owner/SaveHouseInfo',
        method: 'post',
        data,
    });
}

//业主购房分页列表
export function getOwnerHouseList(data) {
    return request({
        url: '/Owner/GetOwnerHouseList',
        method: 'post',
        data,
    });
}

//设置购房状态
export function setOwnerHouseState(data) {
    return request({
        url: '/Owner/SetOwnerHouseState',
        method: 'post',
        data,
    });
}

//业主购房全部信息
export function getOwnerHouseListAll(data) {
    return request({
        url: '/Owner/GetOwnerHouseListAll',
        method: 'post',
        data,
    });
}

//业主补全信息
export function saveComHouseInfo(data) {
    return request({
        url: '/Owner/SaveComHouseInfo',
        method: 'post',
        data,
    });
}

//保存物流地址
export function saveAddressInfo(data) {
    return request({
        url: '/Public/SaveAddressInfo',
        method: 'POST',
        data,
    });
}

export function GetParkingFavoriteInfo(data) {
    return request({
        url: '/Owner/GetParkingFavoriteInfo?id=' + data,
        method: 'GET',
    });
}
//上传图片
export function UploadOwnerFile(data, file) {
    console.log(data);
    return upload('/Upload/UploadOwnerFile?BankMaterialID=' + data, file);
}
//上传付款凭证
export function UploadParkingOrderFile(data, file) {
    console.log(data);
    return upload('/Upload/UploadParkingOrderFile?orderId=' + data, file);
}

//租售车位
export function getParkingRentList(data) {
    return request({
        url: '/Owner/GetParkingRentList',
        method: 'POST',
        data,
    });
}

//租售车位列表
export function getParkingRentInfo(id) {
    return request({
        url: '/Owner/GetParkingRentInfo?id=' + id,
        method: 'GET',
    });
}

//我的租售车位
export function getParkingRentListMy(data) {
    return request({
        url: '/Owner/GetParkingRentListMy',
        method: 'POST',
        data,
    });
}

export function getOwnerHouseBuilding(data) {
    return request({
        url: '/Owner/GetOwnerHouseBuilding?bulidingId=' + data,
        method: 'GET',
    });
}
//获取要上传的的资料属性
export function GetBankMaterialsList() {
    return request({
        url: '/Owner/GetBankMaterialsList',
        method: 'POST',
    });
}

//上传0首付金融信息
export function saveBankApply(data) {
    console.log(data);
    return request({
        url: '/Owner/SaveBankApply',
        method: 'POST',
        data,
    });
}

//获取我的地址
export function GetUserAddressInfo() {
    return request({
        url: '/Owner/GetUserAddressInfo',
    });
}
//获取业主信息
export function getOwnerInfo() {
    return request({
        url: '/Owner/GetOwnerInfo',
        method: 'post',
    });
}
//业主引流礼品列表
export function getGiftList() {
    return request({
        url: '/Owner/GetGiftList',
        method: 'post',
    });
}
//发放现金券
export function setBuyCoinByParkingOrderID() {
    return request({
        url: '/Owner/SetBuyCoinByParkingOrderID',
        method: 'post',
    });
}
